<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*
        revocable()
            - 用于撤销代理
            - 再次调用后会报错
     */
    const target = {
        foo: 'bar'
    }
    const handler = {
        get() {
            return 'intercepted'
        }
    }

    const {proxy, revoke} = Proxy.revocable(target, handler)
    console.log(proxy.foo) // intercepted
    console.log(target.foo) // bar
    revoke();
    console.log(proxy.foo) //  报错
</script>
</body>
</html>